<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div id="app">
        <!-- 1、checkbox的单选框 -->
        <!-- 添加label,点文字的时候也可以选中 -->
        <!-- <label for="agree">
            <input type="checkbox" id="agree" v-model='isAgree'>同意协议
        </label>
       <h2>您的选择是：{{isAgree}}</h2>
       <button :disabled="!isAgree">下一步</button> -->

       <!-- 2.多选框 -->
       
           <input type="checkbox" value="篮球" v-model="hobbies">篮球
           <input type="checkbox" value="足球" v-model="hobbies">足球
           <input type="checkbox" value="拍球" v-model="hobbies">拍球
           <input type="checkbox" value="花球" v-model="hobbies">花球
      <h2>您的爱好：{{hobbies}}</h2>

<!-- 值绑定  值不是写死，动态绑定的，服务器获取的 -->
    <labe v-for="item in originHobbies" :for="item">
        <input type="checkbox" :value="item" :id="item" v-model="hobbies">{{item}}
    </label>
     
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                message:'你好呀！',
                isAgree:false,
                hobbies:[],
                originHobbies:["篮球","足球","拍球","排球","高尔夫球","乒乓球"]
            },
            methods:{
                valueChange(event){
                    // this.message = 'aaaa'
                    this.message = event.target.value;
                    // console.log("----")
                }
            }

        })
    </script>
</body>
</html>